|
![](/i/fill.gif) |
hello,
as probed different lamps i get confused as i tried this:
a lamp consists of a quarter of a sphere and has a flat cylinder on it
which emitts the light and hangs on a wall (see pic).
at first i tried to make this object and give to light_source the parameter
"look_as", second i build this object with a light_source in it.
both times the results are not satifactionally (see pics).
does someone know what i did not see?
first call:
light_source {
< 0,0,0 >
color White
looks_like { hohllampe (off)}
translate < towhereyouwant >
}
second call:
object { hohllampe(on)
translate < towhereyouwant >
}
//code for
//------------------------------hohllampe
//glow = on -> self glowing
//glow = whatyouwant -> not self glowing
#macro hohllampe (glow)
union{
difference{
//main body
sphere {
<0,0,0>,1
scale <0.15,0.15,0.15>
}
//two boxes cut the sphere
box {
<-0.5,0,-0.5>,<0.5,1,0.5>
}
box {
<-0.5,-0.5,0>,<0.5,0.5,1>
}
pigment {color White}
//finish {ambient 0}
}//difference main body
//light source
cylinder{
<0,0,0>,<0,1,0>,1
scale <0.15,0.01,0.15>
pigment { color White}
no_shadow
finish{ ambient 0.25}
}
#if (glow=on)
light_source {
<0.07,0.005,-0.07>
color White
adaptive 1
}
#end//if
}//union
#end//macro
//------------------------------hohllampe
Post a reply to this message
Attachments:
Download 'lampprob.jpg' (9 KB)
Preview of image 'lampprob.jpg'
![lampprob.jpg](/povray.binaries.images/attachment/%3C3be6ad6d%40news.povray.org%3E/lampprob.jpg?preview=1)
|
![](/i/fill.gif) |